package com.lc202407;

import java.util.HashSet;
import java.util.Set;

public class Solution575 {
    public int distributeCandies(int[] candyType) {
        int length = candyType.length;
        Set<Integer> set = new HashSet<>();
        for (int i : candyType) {
            set.add(i);
        }
        return Math.min(length / 2, set.size());
    }
}
